when the first term a and the common difference d are given as follows